import axios from 'axios';

export async function getAllNavs() {
    let resp = await axios.get("/api/navs");
    console.log("resp:",resp);
    return resp.data;
}

export async function deleteNavs(_id) {
    let resp = await axios.delete("/api/navs/" + _id);
    return resp.data;
}

export async function addTB(form) {
    let {icon,name,createTime} = form;
    let resp = await axios.post("/api/navs", {
        icon,
        name,
        createTime
    });
    console.log(icon,name,createTime);
    return resp.data;
}

export async function gaiTB(form1) {
    let {_id,icon,name, createTime} =form1
    console.log(form1);
    let resp = await axios.put("/api/navs/" + _id, {icon,name, createTime});
    console.log("resp:",resp);
    return resp.data;
}